package com.xsd.command;

/**
 * @Description: 开灯
 * @Author: zhoufuzong
 * @Created: 2021-03-06 15:37:03
 * @Version: 1.1.0
 */

public class LightOnCommand implements Command{
   LightReceiver lightReceiver;

    public LightOnCommand(LightReceiver lightReceiver) {
        super();
        this.lightReceiver = lightReceiver;
    }


    @Override
    public void execute() {
        // 调用接收者的方法
        lightReceiver.on();
    }



    @Override
    public void undo() {
        // 调用接收的方法
        lightReceiver.off();
    }
}
